﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Practices.Unity;

using ERPStore.Extensions;

namespace ERPStore.MockConnector
{
	public class PluginInit : ERPStore.Extensibility.PluginInit
	{
		public override void AddServices()
		{
			var container = GlobalConfiguration.Configuration.DependencyResolver.GetContainer();

			// Repositories
			container.RegisterType<Repositories.CatalogRepository>(new ContainerControlledLifetimeManager());
			container.RegisterType<Repositories.RegistrationRepository>(new ContainerControlledLifetimeManager());
			container.RegisterType<Repositories.AddressRepository>(new ContainerControlledLifetimeManager());

			// Services
			container.RegisterType<ERPStore.Services.ISettingsService, SettingsService>(new ContainerControlledLifetimeManager());
			container.RegisterType<ERPStore.Services.ICatalogService, CatalogService>(new ContainerControlledLifetimeManager());
			container.RegisterType<ERPStore.Services.ISalesService, SalesService>(new ContainerControlledLifetimeManager());
			container.RegisterType<ERPStore.Services.IAccountService, AccountService>(new ContainerControlledLifetimeManager());
			container.RegisterType<ERPStore.Services.IConnectorService, ConnectorService>(new ContainerControlledLifetimeManager());
			container.RegisterType<ERPStore.Services.IDocumentService, DocumentService>(new ContainerControlledLifetimeManager());
			container.RegisterType<ERPStore.Services.IAddressService, AddressService>(new ContainerControlledLifetimeManager());
			container.RegisterType<ERPStore.Services.IEmailerService, EmailerService>(new ContainerControlledLifetimeManager());

		}

		public override void Load()
		{
			base.Load();
		}

	}
}
